import Generator from './generator';

class Sudoku {

    solutionMatrix;
    puzzleMatrix;

    constructor() {
        const generator = new Generator();
        generator.generate();
        this.solutionMatrix = generator.matrix;
    }

    make(level = 5) {
        this.puzzleMatrix = this.solutionMatrix.map(row => {
            return row.map(cell => Math.random() * 9 < level ? 0 : cell)
        });
    }
}

export default Sudoku;
